<template>
    <div>
         <vheader :ismini="iscollapse"></vheader>
         <el-container style="border:0px solid #e3e3;" id="content_module">
            <el-main>
                <el-row :gutter="20">
                    <el-col :push="1" :span="4" :sx="4" :sm="4" :md="4" :lg="4" :xl="4" class="vleft_content" style="overflow:hidden;overflow-y:auto;">
                        <vleft :subjectid="sid" :attributeid="aid" :iscollapse="iscollapse" page="contentedit"></vleft>
                    </el-col>
                    <el-col :push="1" :span="18" :sx="18" :sm="18" :md="18" :lg="18" :xl="18" class="vRight_content"  style=" overflow:hidden;overflow-y:auto;">
                        <vContentEditMain :subjectid="sid" :attributeid="aid" mode="edit" :iscollapse="iscollapse"></vContentEditMain>
                    </el-col>
                </el-row>
            </el-main>
        </el-container>
         <vfooter></vfooter>
    </div>
</template>
<script>
import vheader from "../common/Header";
import vfooter from "../common/Footer";
import vContentEditMain from "../common/ContentEditMain";
import vleft from "../common/Left";

//接口

export default {
  data() {
    return {
      iscollapse: false,
      sid: 0,
      aid: 0
    };
  },
  watch: {
    $route: "fetchData"
  },
  components: {
    vheader,
    vfooter,
    vleft,
    vContentEditMain
  },
  methods: {
    fetchData: function() {
      this.sid = this.$route.params.sid;
      this.aid = this.$route.params.aid;
    },
    handleSelect(key, keyPath) {
      // debugger
      // this.$router.push({ path : keyPath});
      console.log(key, keyPath);
    }
  },
  mounted: function() {
    let self = this;
    window.onresize = function() {
      self.clientHeight =
        document.documentElement.clientHeight - (this.isshowfooter ? 160 : 100);
      self.clientWidth = document.documentElement.clientWidth;
      // $("#content_module").height(self.clientHeight);
      $(".vleft_content").height(self.clientHeight);
      $(".vRight_content").height(self.clientHeight);

      //获取宽度
      self.iscollapse = self.clientWidth < 768;
    };
    window.onresize();
  },
  created() {
    this.fetchData();
  }
};
</script>
<style scoped>
#content_module {
  padding: 0;
  margin: 0 auto;
}
.el-main {
}
</style>